package controller;

import java.awt.List;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import gui.SLogoGUI;
import model.Model;

/**
 * Main controller class for system. Organizes other sub controllers for system
 * 
 * @author Troy Ferrell
 */
public class SLogoController extends AbstractController
{	
	private Map<String, AbstractController> myControllers = new HashMap<String, AbstractController>();

	public SLogoController(Model model)
	{
		super(model);
		
		WorkspaceController workspaceController = new WorkspaceController(model);
		myControllers.put( workspaceController.getClass().getName(),  workspaceController );
		
		PropertiesController propertiesController = new PropertiesController(model);
		myControllers.put( propertiesController.getClass().getName(), propertiesController );
		
		WindowsController windowsController = new WindowsController(model);
		myControllers.put(windowsController.getClass().getName(), windowsController);
		
		SceneController sceneController = new SceneController(model);
		myControllers.put(sceneController.getClass().getName(), sceneController);
	}

	public AbstractController getControllerFor(String className)
	{
		AbstractController controller = myControllers.get(className);
		if(controller == null)
		{
			// TODO notify user that system initializaiton failed...shutting down 
			System.exit(1);
		}
		
		return controller;
	}
}
